<?php
class Router extends Router_Core {
    public static function setup() {
        $kohanaStyle = Kohana::config('routes._kohanaStyle');
        Kohana::config_set('routes._kohanaStyle','');
        parent::setup();
        if (!in_array(self::$controller, $kohanaStyle)) {
            $prefix = "on";
            switch (substr(self::$method,0,1)) {
                case "!": $prefix = "do"; break;       //Action
                case "*": $prefix = "box"; break;      //get Box content
                case ".": $prefix = "notify"; break;   //notify (no response)
            }
            if ($prefix != "on") {
                self::$method = substr(self::$method,1);
            }
            $arguments = array(
                "prefix"=>$prefix,
                "method"=>self::$method,
                "arguments"=>self::$arguments
            );
            self::$method = "handleRequest";
            self::$arguments = $arguments;
        }
    }

    public static function find_uri() {
        $_SERVER['QUERY_STRING'].="&_GET=";
        parent::find_uri();
        $_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'],0,-6);
    }
}
?>